﻿
    <table class="table table-bordered">
        <tr data-ng-repeat="pokemon in test" |orderby:'length'>
            <td>
                <span ng-show="editing">
                    <input type="text" data-ng-model="pokemon.name" ng-show="editing" />
                    <select data-ng-model="pokemon.type">
                        <option value="bolt">electric</option>
                        <option value="fire">fire</option>
                        <option value="tint">water</option>
                    </select>
                    <button data-ng-click="editing=false; updatePokemon(pokemon)">Save</button>
                </span>

                <span ng-show="!editing" ng-click="editing=true"><i class="fa fa-{{pokemon.type}}"></i>{{pokemon.name}}</span>
            </td>
            <td>{{$index}}</td>
            <td><button data-ng-click="deletePokemon(pokemon)">Del</button></td>
        </tr>

    </table>
</div>